@extends('layouts.default') @section('main')
    <link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/themes/default/default.css" />
    <link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.css" />
    <script src="{{URL::asset('js/')}}/kindeditor-4.1.7/kindeditor.js" type="text/javascript"></script>
    <script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/lang/zh_CN.js"></script>
    <script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.js"></script>
    <script type="text/javascript" src="{{URL::asset('js/')}}/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{{URL::asset('js/')}}/common.js"></script>
    <script src="{{URL::asset('js/My97DatePicker/')}}/WdatePicker.js"></script>
    <script>
        KindEditor.ready(function(K) {

            var editor1 = K.create('#activity_content,#activity_summary,#activity_remark', {
                uploadJson: "{{url('kindedit/upload')}}",
                fileManagerJson: "{{url('kindedit/manager')}}",
                allowFileManager: true,
                afterBlur: function() {
                    this.sync();
                },
                items: ['source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', 'image', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'table', 'hr', 'emoticons', 'pagebreak', 'anchor', 'link', 'unlink', '|']
            });

        });
    </script>
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
                            class="icon-home"></i> 首页</a> <a href="{{url('activity/index')}}"
                                                             class="tip-bottom">活动管理</a>
                <a href="#" class="current">签到二维码</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span9">
                    <div class="widget-box">
                        <div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
                            <h5>签到二维码</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form action="{{url('activity/update')}}" method="post" class="form-horizontal" id="activityForm">

                                <div class="control-group">
                                    <label class="control-label">签到二维码 :</label>
                                    <div class="controls">
                                        <img src="{{getImage($activity->qrcode_sign,'avatar','',0)}}" width="200px" name="wx_photo" height="200px"/>

                                    </div>
                                </div>

                                <div class="form-actions">
                                    <input type="hidden" name="id" value="{{$id}}">
                                    <input type="hidden" name="url" value="{{url('activity/sign-code')}}">

                                    <button type="button" id="doSave" class="btn btn-success">重新生成</button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>

        $("#doSave").click(function(){
            param={};
            param.id=$('input[name=id]').val();

            ajaxRequest(param, "{{url('activity/sign-code')}}",function(data){
                if(data.status){
                    alert(data.message);
                    window.location.href = data.forwardUrl;
                }else{
                    alert(data.message);
                }
            });
        });
    </script>

@stop
